// 赛博朋克主题样式 - Cyberpunk Theme Styles

// SCSS 变量定义
// 主色调
$cyber-primary: #32ec8a;
$cyber-primary-dark: #28c470;
$cyber-primary-light: #5ef0a4;

// 次要色调
$cyber-secondary: #ff6b6b;
$cyber-secondary-dark: #cc5555;
$cyber-secondary-light: #ff8888;

// 强调色
$cyber-accent: #00ff7f;
$cyber-accent-dark: #00cc66;
$cyber-accent-light: #33ff99;

// 背景色
$cyber-bg-primary: #0a0a0a;
$cyber-bg-secondary: #1a1a2e;
$cyber-bg-tertiary: #16213e;
$cyber-bg-card: rgba(26, 26, 46, 0.8);
$cyber-bg-overlay: rgba(0, 0, 0, 0.7);
$cyber-bg-glass: rgba(255, 255, 255, 0.1);

// 文字色
$cyber-text-primary: #ffffff;
$cyber-text-secondary: rgba(255, 255, 255, 0.8);
$cyber-text-muted: rgba(255, 255, 255, 0.6);
$cyber-text-disabled: rgba(255, 255, 255, 0.4);

// 边框色
$cyber-border-primary: rgba(50, 236, 138, 0.3);
$cyber-border-secondary: rgba(255, 255, 255, 0.2);
$cyber-border-accent: rgba(0, 255, 127, 0.3);

// 阴影
$cyber-shadow-primary: 0 0 20px rgba(50, 236, 138, 0.3);
$cyber-shadow-secondary: 0 0 15px rgba(255, 107, 107, 0.3);
$cyber-shadow-accent: 0 0 15px rgba(0, 255, 127, 0.3);
$cyber-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

// 渐变
$cyber-gradient-primary: linear-gradient(45deg, $cyber-primary, $cyber-primary-dark);
$cyber-gradient-secondary: linear-gradient(45deg, $cyber-secondary, $cyber-secondary-dark);
$cyber-gradient-accent: linear-gradient(45deg, $cyber-accent, $cyber-accent-dark);
$cyber-gradient-bg: linear-gradient(135deg, $cyber-bg-primary 0%, $cyber-bg-secondary 50%, $cyber-bg-tertiary 100%);

// 动画时长
$cyber-transition-fast: 0.2s;
$cyber-transition-normal: 0.3s;
$cyber-transition-slow: 0.5s;

// 边框半径
$cyber-radius-small: 5px;
$cyber-radius-medium: 8px;
$cyber-radius-large: 12px;
$cyber-radius-xl: 16px;

// 间距
$cyber-spacing-xs: 4px;
$cyber-spacing-sm: 8px;
$cyber-spacing-md: 16px;
$cyber-spacing-lg: 24px;
$cyber-spacing-xl: 32px;
$cyber-spacing-2xl: 48px;

// 全局样式重置
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: $cyber-gradient-bg;
  color: $cyber-text-primary;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: $cyber-bg-secondary;
  border-radius: $cyber-radius-small;
}

::-webkit-scrollbar-thumb {
  background: $cyber-gradient-primary;
  border-radius: $cyber-radius-small;
  transition: background $cyber-transition-normal ease;

  &:hover {
    background: $cyber-primary-light;
  }
}

// 选择文本样式
::selection {
  background: rgba(50, 236, 138, 0.3);
  color: $cyber-text-primary;
}

::-moz-selection {
  background: rgba(50, 236, 138, 0.3);
  color: $cyber-text-primary;
}

// 通用工具类
.cyber-glow {
  box-shadow: $cyber-shadow-primary;
}

.cyber-glow-secondary {
  box-shadow: $cyber-shadow-secondary;
}

.cyber-glow-accent {
  box-shadow: $cyber-shadow-accent;
}

.cyber-border {
  border: 1px solid $cyber-border-primary;
}

.cyber-border-secondary {
  border: 1px solid $cyber-border-secondary;
}

.cyber-bg-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cyber-text-gradient {
  background: $cyber-gradient-primary;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

// 动画关键帧
@keyframes cyber-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

@keyframes cyber-glow-pulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(50, 236, 138, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(50, 236, 138, 0.6);
  }
}

@keyframes cyber-slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cyber-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cyber-scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cyber-rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes cyber-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

// 动画工具类
.cyber-animate-pulse {
  animation: cyber-pulse 2s ease-in-out infinite;
}

.cyber-animate-glow {
  animation: cyber-glow-pulse 2s ease-in-out infinite;
}

.cyber-animate-slide-in {
  animation: cyber-slide-in $cyber-transition-slow ease-out;
}

.cyber-animate-fade-in {
  animation: cyber-fade-in $cyber-transition-normal ease-out;
}

.cyber-animate-scale-in {
  animation: cyber-scale-in $cyber-transition-normal ease-out;
}

.cyber-animate-float {
  animation: cyber-float 3s ease-in-out infinite;
}

// 按钮样式
.cyber-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: $cyber-spacing-sm;
  padding: $cyber-spacing-sm $cyber-spacing-md;
  border: 1px solid $cyber-border-primary;
  border-radius: $cyber-radius-small;
  background: $cyber-bg-glass;
  color: $cyber-text-primary;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all $cyber-transition-normal ease;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left $cyber-transition-slow ease;
  }

  &:hover {
    border-color: $cyber-primary;
    box-shadow: $cyber-shadow-primary;
    transform: translateY(-2px);

    &::before {
      left: 100%;
    }
  }

  &:active {
    transform: translateY(0);
  }

  &.cyber-btn-primary {
    background: $cyber-gradient-primary;
    border-color: $cyber-primary;
    color: $cyber-text-primary;
  }

  &.cyber-btn-secondary {
    background: $cyber-gradient-secondary;
    border-color: $cyber-secondary;
    color: $cyber-text-primary;
  }

  &.cyber-btn-accent {
    background: $cyber-gradient-accent;
    border-color: $cyber-accent;
    color: $cyber-bg-primary;
  }
}

// 卡片样式
.cyber-card {
  position: relative;
  background: $cyber-bg-card;
  border: 1px solid $cyber-border-primary;
  border-radius: $cyber-radius-small;
  padding: $cyber-spacing-lg;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: $cyber-shadow-card;
  transition: all $cyber-transition-normal ease;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: $cyber-gradient-primary;
    opacity: 0;
    transition: opacity $cyber-transition-normal ease;
  }

  // &:hover {
  //   border-color: $cyber-primary;
  //   box-shadow: $cyber-shadow-primary, $cyber-shadow-card;
  //   transform: translateY(-4px);

  //   &::before {
  //     opacity: 1;
  //   }
  // }
}

// 输入框样式
.cyber-input {
  width: 100%;
  // padding: $cyber-spacing-sm $cyber-spacing-md;
  background: $cyber-bg-glass;
  border: 1px solid $cyber-border-primary;
  border-radius: $cyber-radius-small;
  color: $cyber-text-primary;
  font-size: 14px;
  transition: all $cyber-transition-normal ease;

  &::placeholder {
    color: $cyber-text-muted;
  }

  &:focus {
    outline: none;
    border-color: $cyber-primary;
    box-shadow: $cyber-shadow-primary;
  }

  &:hover {
    border-color: $cyber-primary-light;
  }
}

// 标签样式
.cyber-tag {
  display: inline-flex;
  align-items: center;
  padding: $cyber-spacing-xs $cyber-spacing-sm;
  background: rgba(50, 236, 138, 0.1);
  border: 1px solid $cyber-border-primary;
  border-radius: $cyber-radius-small;
  color: $cyber-primary;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;

  &.cyber-tag-secondary {
    background: rgba(255, 107, 107, 0.1);
    border-color: $cyber-secondary;
    color: $cyber-secondary;
  }

  &.cyber-tag-accent {
    background: rgba(0, 255, 127, 0.1);
    border-color: $cyber-accent;
    color: $cyber-accent;
  }
}

// 徽章样式
.cyber-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: $cyber-gradient-primary;
  border-radius: 5px;
  color: $cyber-text-primary;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;

  &::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: $cyber-gradient-primary;
    border-radius: 5px;
    opacity: 0.3;
    animation: cyber-glow-pulse 2s ease-in-out infinite;
  }
}

// 分割线样式
.cyber-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, $cyber-border-primary, transparent);
  margin: $cyber-spacing-lg 0;

  &.cyber-divider-vertical {
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, transparent, $cyber-border-primary, transparent);
    margin: 0 $cyber-spacing-md;
  }
}

// 加载动画
.cyber-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid $cyber-border-primary;
  border-top: 2px solid $cyber-primary;
  border-radius: 50%;
  animation: cyber-rotate 1s linear infinite;

  &.cyber-loading-large {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
}

// 网格背景
.cyber-grid-bg {
  position: relative;
  background-image: 
    linear-gradient(rgba(50, 236, 138, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 236, 138, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, $cyber-bg-primary 100%);
    pointer-events: none;
  }
}

// 响应式工具类
@media (max-width: 768px) {
  $cyber-spacing-xs: 2px;
  $cyber-spacing-sm: 6px;
  $cyber-spacing-md: 12px;
  $cyber-spacing-lg: 18px;
  $cyber-spacing-xl: 24px;
  $cyber-spacing-2xl: 36px;
  
  .cyber-card {
    padding: $cyber-spacing-md;
  }
  
  .cyber-btn {
    padding: $cyber-spacing-xs $cyber-spacing-sm;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .cyber-card {
    padding: $cyber-spacing-sm;
    border-radius: $cyber-radius-medium;
  }
  
  .cyber-btn {
    width: 100%;
    justify-content: center;
  }
}

// 打印样式
@media print {
  .cyber-glow,
  .cyber-glow-secondary,
  .cyber-glow-accent {
    box-shadow: none;
  }
  
  .cyber-bg-glass {
    background: #ffffff;
    backdrop-filter: none;
  }
  
  .cyber-card {
    border: 1px solid #cccccc;
    box-shadow: none;
  }
}

// 高对比度模式支持
@media (prefers-contrast: high) {
  $cyber-border-primary: rgba(50, 236, 138, 0.8);
  $cyber-border-secondary: rgba(255, 255, 255, 0.6);
  $cyber-text-muted: rgba(255, 255, 255, 0.8);
}

// 减少动画模式支持
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

// 深色模式支持
@media (prefers-color-scheme: dark) {
  // 已经是深色主题，无需额外调整
}

// 浅色模式支持（可选）
@media (prefers-color-scheme: light) {
  // 如果需要支持浅色模式，可以在这里定义
  /*
  $cyber-bg-primary: #f0f0f0;
  $cyber-text-primary: #333333;
  // ... 其他浅色模式变量
  */
}

// 特殊效果类
.cyber-hologram {
  position: relative;
  background: linear-gradient(45deg, transparent 30%, rgba(50, 236, 138, 0.1) 50%, transparent 70%);
  background-size: 20px 20px;
  animation: cyber-hologram-scan 3s linear infinite;
}

@keyframes cyber-hologram-scan {
  0% {
    background-position: -20px 0;
  }
  100% {
    background-position: 20px 0;
  }
}

.cyber-glitch {
  position: relative;

  &::before,
  &::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
  }

  &::before {
    animation: cyber-glitch-1 0.5s infinite;
    color: $cyber-secondary;
    z-index: -1;
  }

  &::after {
    animation: cyber-glitch-2 0.5s infinite;
    color: $cyber-accent;
    z-index: -2;
  }
}

@keyframes cyber-glitch-1 {
  0%, 14%, 15%, 49%, 50%, 99%, 100% {
    transform: translate(0, 0);
  }
  1%, 13% {
    transform: translate(-2px, 0);
  }
  16%, 48% {
    transform: translate(2px, 0);
  }
}

@keyframes cyber-glitch-2 {
  0%, 20%, 21%, 62%, 63%, 99%, 100% {
    transform: translate(0, 0);
  }
  1%, 19% {
    transform: translate(2px, 0);
  }
  22%, 61% {
    transform: translate(-2px, 0);
  }
}

// 粒子效果背景
.cyber-particles {
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
      radial-gradient(circle at 20% 80%, rgba(50, 236, 138, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(0, 255, 127, 0.1) 0%, transparent 50%);
    animation: cyber-particles-float 10s ease-in-out infinite;
    pointer-events: none;
  }
}

@keyframes cyber-particles-float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}